package org.wdcode.back.helper;

import java.util.Map;

import org.wdcode.back.constants.BackConstants;
import org.wdcode.back.constants.I18NKey;

import org.wdcode.common.tools.Maps;

/**
 * 助手类
 * @author WD
 * @since JDK6
 * @version 1.0 2009-09-11
 */
public final class BackHelper {
	// 保存性别
	private final static Map<Short, String>	SEX;
	// 保存状态
	private final static Map<Short, String>	STATE;
	// 保存登录状态
	private final static Map<Short, String>	LOGIN_STATE;
	// 保存显示
	private final static Map<Short, String>	DISPLAY;

	static {
		// 初始化性别
		SEX = Maps.getMap(2);
		SEX.put(BackConstants.SEX_MALE, I18NKey.SEX_MALE);
		SEX.put(BackConstants.SEX_FEMALE, I18NKey.SEX_FEMALE);

		// 初始化状态
		STATE = Maps.getMap(2);
		STATE.put(BackConstants.STATE_AVAIL, I18NKey.STATE_AVAIL);
		STATE.put(BackConstants.STATE_INVALID, I18NKey.STATE_INVALID);

		// 初始化登录状态
		LOGIN_STATE = Maps.getMap(2);
		LOGIN_STATE.put(BackConstants.STATE_AVAIL, I18NKey.LOGIN_STATE_SUCC);
		LOGIN_STATE.put(BackConstants.STATE_INVALID, I18NKey.LGOIN_STATE_ERR);

		// 初始化显示
		DISPLAY = Maps.getMap(2);
		DISPLAY.put(BackConstants.DISPLAY_HIDE, I18NKey.YES);
		DISPLAY.put(BackConstants.DISPLAY_SHOW, I18NKey.NO);
	}

	/**
	 * 获得性别Map
	 * @return Map
	 */
	public final static Map<Short, String> getSex() {
		return SEX;
	}

	/**
	 * 获得状态Map
	 * @return Map
	 */
	public final static Map<Short, String> getState() {
		return STATE;
	}

	/**
	 * 获得登录状态Map
	 * @return Map
	 */
	public final static Map<Short, String> getLoginState() {
		return LOGIN_STATE;
	}

	/**
	 * 获得显示Map
	 * @return Map
	 */
	public final static Map<Short, String> getDisplay() {
		return DISPLAY;
	}
}
